<!--# layout("/common/layout.html",{"jsBase":"/js/customer/member/"}){ -->
<style>
     .span_div{
         margin-top: 9px;
     }
</style>
<form class="layui-form layui-form-pane">
    <table>
        <tr>
            <td rowspan="3">
                <div class="layui-form-item">
                    <div class="layui-inline">
                          <img src="${customerInfo.wxPicurl}" style="width:180px; height:180px;border-radius:50%"/>
                    </div>
                </div>
            </td>
            <td colspan="">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">姓名</label>
                        <div class="layui-input-inline span_div" >
                            <span>
                                ${customerInfo.customerName}
                            </span>
                        </div>
                    </div>
                </div>
            </td>
            <td colspan="2">
                <div class="layui-form-item" id="releNameDiv">

                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">手机号码</label>
                        <div class="layui-input-inline span_div">
                            <span>
                                    ${customerInfo.sourceId}
                            </span>
                        </div>
                    </div>
                </div>

            </td>
            <td>
                <div class="layui-form-item">
                 <div class="layui-inline">
                    <label class="layui-form-label">性别</label>
                    <div class="layui-input-inline span_div">
                       <span id="sexSpan">

                       </span>
                    </div>
                   </div>
                </div>
            </td>
            <td>
                <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">注册时间</label>
                    <div class="layui-input-inline span_div">
                        <span>
                            ${customerInfo.registerTimeStr}
                        </span>
                    </div>
                </div>
                </div>
            </td>
        </tr>
<!--        <tr>-->
<!--            <td>-->
<!--                <div class="layui-form-item">-->
<!--                <div class="layui-inline">-->
<!--                    <label class="layui-form-label">高中信息</label>-->
<!--                    <div class="layui-input-inline span_div" style="width: 300px">-->
<!--                        <span>-->

<!--                        </span>-->
<!--                    </div>-->
<!--                </div>-->
<!--                </div>-->
<!--            </td>-->
<!--        </tr>-->
    </table>
</form>


<!--<form class="layui-form layui-form-pane" id="addForm" enctype="multipart/form-data"  lay-filter="editform">-->
<!--    <fieldset style="border:solid 1px #5FB878;width: 1200px">-->
<!--        <legend>-->
<!--            高考信息-->
<!--            <i class="layui-icon layui-icon-edit" id="edit"  style="font-size: 12px; color: #00CD66;"></i>-->
<!--        </legend>-->
<!--        <input type="hidden" name="customerId" id="customerId">-->
<!--        <br>-->
<!--        <div class="layui-row">-->
<!--            <div class="layui-form-item">-->
<!--                <div class="layui-inline">-->
<!--                    <label class="layui-form-label">高考省份</label>-->
<!--                    <div class="layui-input-inline">-->
<!--                        <input type="text" name="provName" id="provName" autocomplete="off" class="layui-input" readonly>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="layui-inline">-->
<!--                    <label class="layui-form-label">高考年份</label>-->
<!--                    <div class="layui-input-inline">-->
<!--                        <input type="text" name="choiceYear" id="choiceYear" autocomplete="off" class="layui-input" readonly>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="layui-inline">-->
<!--                    <label class="layui-form-label">高考科目</label>-->
<!--                    <div class="layui-input-inline">-->
<!--                        <input type="text" name="subject" id="subject" autocomplete="off" class="layui-input" readonly>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->

<!--        <div class="layui-row">-->
<!--            <div class="layui-form-item">-->
<!--                <div class="layui-inline">-->
<!--                    <label class="layui-form-label">高考分数</label>-->
<!--                    <div class="layui-input-inline">-->
<!--                        <input type="text" name="score" id="score" autocomplete="off" class="layui-input"  readonly>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="layui-inline">-->
<!--                    <label class="layui-form-label">高考排名</label>-->
<!--                    <div class="layui-input-inline" >-->
<!--                        <input type="text" name="rank" id="rank" autocomplete="off" class="layui-input" readonly>-->
<!--                    </div>-->
<!--                </div>-->

<!--            </div>-->
<!--        </div>-->
<!--    </fieldset>-->
<!--</form>-->

<div class="layui-tab">
    <ul class="layui-tab-title">
        <li class="layui-this">购买记录</li>
<!--        <li>激活记录</li>-->
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <table class="layui-table" lay-data="{width:1200 ,url:'${ctxPath}/customer/customerInfo/getOrder.json?customerId=${customerInfo.customerId}', page:false, id:'test1'}" lay-filter="test1">
                <thead>
                    <tr>
                        <th lay-data="{field:'transactionId', width:300}">订单流水号</th>
                        <th lay-data="{field:'orderNo', width:120}">订单编号</th>
                        <th lay-data="{field:'content'}">商品信息</th>
                        <th lay-data="{field:'totalMoney'}">支付金额</th>
                        <th lay-data="{field:'payTime',width:170}">下单时间</th>
                        <th lay-data="{fixed: 'right', width:178, align:'center', toolbar: '#barDemo'}">操作</th>
                    </tr>
                </thead>
            </table>
        </div>
<!--        <div class="layui-tab-item">-->
<!--            <table class="layui-table" lay-data="{width:998 ,url:'${ctxPath}/customer/customerInfo/getOrder.json?type=2&customerId=${customerInfo.customerId}', page:false, id:'test2'}" lay-filter="test2">-->
<!--                <thead>-->
<!--                <tr>-->
<!--                    <th lay-data="{field:'linkId'}">激活码</th>-->
<!--                    <th lay-data="{field:'useTime'}">激活时间</th>-->
<!--                    <th lay-data="{field:'expiredDate'}">失效时间</th>-->
<!--                    <th lay-data="{field:'remark'}">备注</th>-->
<!--                </tr>-->
<!--                </thead>-->
<!--            </table>-->
<!--        </div>-->
    </div>
</div>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="order" id="aaa">订单详情</a>
</script>
<!--#} -->

<script>
    Common.initImage();
    function ChooseAdidValues(majorType,subject,choiceYear,provName,score,rank,choiceMode) {
        if(choiceMode!=0){
            $("#subject").val(subject);
        }else{
            if(majorType==1){
                $("#subject").val("文科");
            }else{
                $("#subject").val("理科");
            }
        }
        $("#choiceYear").val(choiceYear);
        $("#provName").val(provName);
        $("#score").val(score);
        $("#rank").val(rank);
    }
layui.define([ 'form', 'laydate', 'table','memberApi'], function(exports) {
    var form = layui.form;
    var memberApi = layui.memberApi;
    var index = layui.index;
    var table = layui.table;
    var laydate = layui.laydate;
    var isNew = true;
    $("#addForm").hide();
    <!--# if(!(isEmpty(customerInfoJson))){  -->
    isNew = false;
    <!--# } -->
    $("#courseGroupIdDiv").hide();

    table.on('tool(test1)', function(obj){
        var data = obj.data;
        if(obj.event=='order'){
            parent.order(data.transactionId);
        }
    });
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();

            // table.on('toolbar(test1)', function(obj){
            //     var data = obj.data;
            //     console.dir(obj)
            //
            // });
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                form.on('submit(form)', function(){
                    memberApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });
            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }

    $('#aaa').click(function(){

    });

    $("#edit").click(function () {
        layer.open({
            type:2
            ,title:"设置高考信息"
            ,area:['480px','500px']
            ,content:['${ctxPath}/customer/customerInfo/infoEdit.do?customerId=${customerInfo.customerId}&tenantId=${customerInfo.tenantId}']

        })

    });

    form.on('select(majorTypeSelect)', function(data){
        if(data.value==3){
            $("#courseGroupIdDiv").show();
        }else{
            $("#courseGroupIdDiv").hide();
        }
    });
    view.init();
    <!--# if(!(isEmpty(customerInfoJson))){  -->
    var formJson = ${customerInfoJson};

    if(formJson.majorType==1){
        $("#subject").val("文科");
    }else if(formJson.majorType==2){
        $("#subject").val("理科");
    }else if(formJson.majorType==3){
        if(formJson.courseGroup){
            $("#subject").val(formJson.courseGroup.replace(/\,/g,"/"));
        }
    }

    if(formJson.sex==1){
        $("#sexSpan").text("男");
    }else if(formJson.sex==2){
        $("#sexSpan").text("女");
    }
    if(formJson.rolesName){
        var roleNames = formJson.rolesName.split(",");
        var roleHtml="";
        $.each(roleNames,function (index,value) {
            roleHtml+='<button type="button" class="layui-btn">'+value+'</button>';
        });
        $("#releNameDiv").append(roleHtml);
    }
    form.val("editform",formJson);
    $(".image-preview").each(function() {
        $(this).attr("src",formJson[$(this).attr("id")]);
    });
    <!--# } -->

});
</script>
